/*        This file is part of P5ovray.
        
        P5ovray is free software: you can redistribute it and/or modify
        it under the terms of the GNU Lesser General Public License as 
        published by the Free Software Foundation, either version 3 of 
        the License, or (at your option) any later version.
        
        P5ovray is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU Lesser General Public License for more details.
        
        You should have received a copy of the GNU Lesser General Public
        License along with P5ovray.  If not, see <http://www.gnu.org/licenses/>.
*/


package zombie.povray;

import processing.core.PApplet;
import zombie.P5ovray;

public class P5ovModel extends P5ovObject {

    private P5ovray parent;
    
    public P5ovModel(P5ovray _parent)
    {
        super("mesh");
        parent = _parent;
        
    }
    
    public void addTriangle( float[] a, float[] b, float[] c, boolean smooth) {
        
        /*if (a.length != 3 || b.length != 3 || c.length != 3) {
            PApplet.println("Triangle vertex has more than 3 points. This shouldn't happen!");
            return;
        }*/
        
        
        
        String triLoc = "<" + a[0] +", " + a[1] + ", " + a[2] + ">, <" + 
                b[0] + ", " + b[1] + ", " + b[2] + ">, <" + 
                c[0] + ", " + c[1] + ", " + c[2] + ">\n";
        
        P5ovObject tri = new P5ovObject( (smooth)?"smooth_triangle":"triangle", triLoc );
        this.addObject(tri);
        
        
        
        
    }
    
}
